package com.bulletelc.apollopre.entity;

import java.util.List;

/**
 * author: lhl
 * date  : 2018/01/13
 * desc  : 分类，一级和二级
 */

public class Classify {

    private String id;
    private String name;
    private String label;
    private String imageUrl;
    private List<Classify> classifyList;
    private String ids;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public List<Classify> getClassifyList() {
        return classifyList;
    }

    public void setClassifyList(List<Classify> classifyList) {
        this.classifyList = classifyList;
    }

    public String getIds() {
        return ids;
    }

    public void setIds(String ids) {
        this.ids = ids;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String toString() {
        return "Classify{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                '}';
    }

    public String getHomeCateIds(Classify classify) {
        String ids = "";
        ids += classify.getId();
        List<Classify> classifyList = classify.getClassifyList();
        if (classifyList.size() > 0) {
            for (int i = 0; i < classifyList.size(); i++) {
                ids += "," + classifyList.get(i).getId();
            }
        }
        return ids;
    }

}
